﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;

namespace MySimpleWCFService.interfaсes
{
    /// <summary>
    /// Work with VoipNow Extensions
    /// Author: alexandr.pec@skypro.ch
    /// </summary>
    [ServiceContract]
    public interface IVoipNowWorks
    {

        /// <summary>
        /// Create New Extension by SOAP
        /// </summary>
        /// <param name="paramLogin">Extension Login</param>
        /// <param name="paramPassword">Extension Password</param>
        /// <param name="paramEmail">Extension Email</param>
        /// <param name="paramName">Extension Name</param>
        /// <returns>Extension extended name(For Example:"0003*005"). Empty string if not success</returns>
        [OperationContract]
        string AddExtension(
            string paramLogin, 
            string paramPassword, 
            string paramEmail, 
            string paramName);

        /// <summary>
        /// Add Minutes/money to extension
        /// </summary>
        /// <param name="paramExtensionSIPLogin">Extension extended name(For Example:"0003*005").</param>
        /// <param name="paramMinutesCount">Minutes count </param>
        /// <param name="paramCredit">Money</param>
        [OperationContract]
        bool AppendConversationLimitDouble(
            string paramExtensionSIPLogin,
            int paramMinutesCount,
            double paramCredit);

        /// <summary>
        /// Add Minutes/money to extension
        /// </summary>
        /// <param name="paramExtensionSIPLogin">Extension extended name(For Example:"0003*005").</param>
        /// <param name="paramMinutesCount">Minutes count </param>
        /// <param name="paramCredit">Money</param>
        [OperationContract]
        bool AppendConversationLimit(
            string paramExtensionSIPLogin,
            int paramMinutesCount,
            int paramCredit);

        /// <summary>
        /// Delete extension
        /// </summary>
        /// <param name="paramExtensionSIPLogin">SIP login. (2318*009)</param>
        /// <returns>Success status</returns>
        [OperationContract]
        bool DeleteExtension(string paramExtensionSIPLogin);
        
        /// <summary>
        /// Set New Password for Extension
        /// </summary>
        /// <param name="paramID">Extensin identifier</param>
        /// <param name="paramExtensionSIPLogin">SIP Login (2318*003)</param>
        /// <param name="paramOldPassword">Check old password</param>
        /// <param name="paramNewPassword">New password</param>
        /// <param name="paramForce">No check old pass</param>
        /// <returns>false - old password not equal, true - OK</returns>
        [OperationContract]
        bool SetExtensionPasswordBySIPLogin(
            string paramExtensionSIPLogin,
            string paramOldPassword,
            string paramNewPassword,
            bool paramForce);

        /// <summary>
        /// Get total calls credit sum.
        /// </summary>
        /// <param name="paramExtensionSIPLogin">SIP Login (2318*003)</param>
        /// <param name="IsIncomingCallsCredit">true: Remaining incoming calls credit, false:Remaining outgoing calls credit</param>
        /// <returns>Sum value</returns>
        [OperationContract]
        double GetConversationTotalSum(
                string paramExtensionSIPLogin,
                bool IsIncomingCallsCredit);

        /// <summary>
        /// Test Method
        /// </summary>
        [OperationContract]
        void TestGetData();

        /// <summary> return Call reports </summary>
        /// <param name="paramExtensionSIPLogin">SIP Login. Example: "2318*003"</param>
        /// <param name="paramDateFrom"> Date From </param>
        /// <param name="paramDateTo"> Date To </param>
        /// <param name="IsIncomingCalls">Show Incoming calls</param>
        /// <param name="IsOutgoingCalls">Show Outgoing calls</param>
        /// <returns>DataSet with table</returns>
        [OperationContract]
        DataSet GetCallReport(
            string paramExtensionSIPLogin, DateTime paramDateFrom, DateTime paramDateTo,
            bool paramIsIncomingCalls, bool paramIsOutgoingCalls);
    }

}
